package verwaltung;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

@Entity
@NamedQueries({
		@NamedQuery(name="standort", query="SELECT s FROM Standort s WHERE s.Name = :name"),
		@NamedQuery(name="allestandort", query="SELECT s FROM Standort s")})
public class Standort implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	private String Name;
	private String Anschrift;
	private String Stadt;
	
	public Standort(){
		
	}
	
	public 	Standort(String name, String anschrift, String stadt) throws NumberFormatException{
		setName(name);
		setAnschrift(anschrift);
		setStadt(stadt);
	}
	
	public String getName() {
		return Name;
	}
	
	public void setName(String name) {
		Name = name;
	}
	public String getAnschrift() {
		return Anschrift;
	}
	public void setAnschrift(String anschrift) {
		Anschrift = anschrift;
	}
	public String getStadt() {
		return Stadt;
	}
	public void setStadt(String stadt) {
		Stadt = stadt;
	}

	@Override
	public String toString() {
		return getName();
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((Name == null) ? 0 : Name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Standort other = (Standort) obj;
		if (Name == null) {
			if (other.Name != null)
				return false;
		} else if (!Name.equals(other.Name))
			return false;
		return true;
	}
	
	
}
